package routes

import (
	"game-server/app/controllers/admin"

	"github.com/gin-gonic/gin"
)

func SetSysMenuRoutes(router *gin.RouterGroup) {
	adminRouter := router.Group("/admin")
	{
		// 需要认证的路由
		// authRouter := adminRouter.Use(middleware.JWTAuth("admin"))
		authRouter := adminRouter
		{
			//查询所有菜单 buildTree
			authRouter.GET("/menu/alllist", admin.SysMenuAllList)
			//根据id删除
			authRouter.DELETE("/menu/:id", admin.SysMenuDelete)
			//添加菜单节点
			authRouter.POST("/menu", admin.SysMenuAdd)
			//根据id查询菜单节点
			authRouter.GET("/menu/:id", admin.SysMenuGet)
			//根据id更新菜单节点
			authRouter.PUT("/menu/:id", admin.SysMenuUpdate)
			//根据角色id查询权限
			authRouter.GET("/menu/role/:roleId", admin.SysMenuRoleGet)
			//分配权限
			authRouter.PUT("/menu/assignMenu", admin.SysMenuAssignMenu)
			//分页条件查询
			authRouter.GET("/menu/list", admin.SysMenuList)

		}
	}
}
